<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- 是vue出的监听指令 可以监听 click -->
          <button v-on:click='fn1(5)'>点击+1</button>
         <h1>{{num}}</h1>
    </div>


    <script>
     
        var app = new Vue({
            el: '#app',
            data: {
                message: 'Hello Vue22222!',
                num:100
            },
            methods:{
                fn1(num1){
                    console.log('fn1点击了')
                    // app.$data.num++
                    // app.num++
                    console.log('this',this)
                    console.log('app',app)

                    // this.$data.num++ 
                    this.num += num1
                }
            }
        })

        console.log('app', app)

    </script>
</body>

</html>